{{>partial_header}}
syntax = "proto3";

package {{#lambda.lowercase}}{{{packageName}}}.{{{apiPackage}}}.{{{classname}}};{{/lambda.lowercase}}

{{#customOptionsApi}}
{{{.}}}
{{/customOptionsApi}}
import "google/protobuf/empty.proto";
{{#imports}}
{{#import}}
import public "{{{import}}}.proto";
{{/import}}
{{/imports}}

service {{classname}} {
{{#operations}}
{{#operation}}
  {{#description}}
  // {{{.}}}
  {{/description}}
  rpc {{operationId}} ({{#hasParams}}{{operationId}}Request{{/hasParams}}{{^hasParams}}google.protobuf.Empty{{/hasParams}}) returns ({{#vendorExtensions.x-grpc-response}}{{.}}{{/vendorExtensions.x-grpc-response}}{{^vendorExtensions.x-grpc-response}}{{operationId}}Response{{/vendorExtensions.x-grpc-response}});

{{/operation}}
{{/operations}}
}

{{#operations}}
{{#operation}}
{{#hasParams}}
message {{operationId}}Request {
  {{#allParams}}
  {{#description}}
  // {{{.}}}
  {{/description}}
  {{#vendorExtensions.x-protobuf-type}}{{.}} {{/vendorExtensions.x-protobuf-type}}{{vendorExtensions.x-protobuf-data-type}} {{paramName}} = {{vendorExtensions.x-protobuf-index}}{{#vendorExtensions.x-protobuf-json-name}} [json_name="{{vendorExtensions.x-protobuf-json-name}}"]{{/vendorExtensions.x-protobuf-json-name}};
  {{/allParams}}

}

{{/hasParams}}
{{^vendorExtensions.x-grpc-response}}
message {{operationId}}Response {
  {{{vendorExtensions.x-grpc-response-type}}} data = 1;
}

{{/vendorExtensions.x-grpc-response}}
{{#supportMultipleResponses}}
message {{operationId}}Response {
    oneof response {
    {{#responses}}
        {{{vendorExtensions.x-oneOf-response-type}}} {{vendorExtensions.x-oneOf-response-name}}_{{code}} = {{vendorExtensions.x-oneOf-response-index}};
    {{/responses}}
    }
}
{{/supportMultipleResponses}}
{{/operation}}
{{/operations}}
